import type { PageParams, PageResult } from '@/http/types'
import { http } from '@/http/http'

export interface IFooItem {
  id: string
  name: string
}

// banner参数扩展
export interface IContentItem extends PageParams {
  type: string
}

// 商品参数扩展
export interface IGoodsItem extends PageParams {
  discount?: number
  cate_id?: number
  recommend?: number
}
/** 商品列表 */
export function getGoodsAPI(params: IGoodsItem) {
  return http.get<PageResult<any>>('/goods_list', params)
}
/** 商品分类 */
export function getGoodsCateAPI(params: IGoodsItem) {
  return http.get<PageResult<any>>('/goods_cate', params)
}

/** 获取内容 */
export function getContentAPI(params: IContentItem) {
  return http.get<PageResult<any>>('/content_list', params)
}
/** 获取附件 */
export function getAttachAPI(params: PageParams) {
  return http.post<PageResult<any>>('/list_attach', params)
}

/** 支付 */
export function wxPaymentAPI(data: any) {
  return http.post('/wechat_pay', data)
}

// /** POST 请求；支持 传递 header 的范例 */
// export function postFooAPI3(name: string) {
//   return http.post<IFooItem>('/foo', { name }, { a: 1, b: 2 }, { 'Content-Type-100': '100' })
// }
